<template>
  <div class="demo">
    <h1>{{name}}</h1>
    <h2>{{address}}</h2>
    <button @click="sendName">把学校名给APP</button><br>
  </div>
</template>

<script>

export default {
  name: 'SchoolView',
  data() {
    return {
      name: '清华大学',
      address: '北京'
    }
  },
  props: ['getName'],
  methods: {
    sendName() {
      this.getName(this.name)
    }
  }
}
</script>

<style scoped>
  .demo {
    background: skyblue;
    border: 1px solid skyblue;
    padding: 10px;
    margin-top: 20px;
  }
</style>